package com.xinzhi.savingpot.background.service.impl;

import com.xinzhi.savingpot.background.mapper.ISystemTaskCheckMapper;
import com.xinzhi.savingpot.background.service.ITaskStateService;
import com.xinzhi.savingpot.util.BaseResponse;
import com.xinzhi.savingpot.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class TaskStateServiceImpl implements ITaskStateService {

    @Autowired
    ISystemTaskCheckMapper iSystemTaskCheckMapper;
    @Autowired
    private RedisUtil redisUtil;
    @Override
    public BaseResponse changeTaskState(String taskNumber, String taskStateId,String explain) {
        if (taskNumber!=null&&taskStateId!=null){

            Integer newTaskStateId = Integer.parseInt(taskStateId);
            int count = iSystemTaskCheckMapper.changeTaskState(taskNumber, newTaskStateId);
            if (count>0){
                return new BaseResponse(0,"修改成功");

            }
            return new BaseResponse(-1,"修改失败");
        }
        return new BaseResponse(-1,"数据不全");
    }
}
